from .AIAssistant import AIAssistant

class TextGenerationAssistant(AIAssistant):
    """文本生成助手类，专门用于处理文本生成相关任务"""
    
    def __init__(self, id, name, version, online, score, language, is_creative):
        super().__init__(id, name, "文本生成助手", version, online, score)
        self._language = language
        self._is_creative = is_creative
    
    # Getter和Setter方法
    @property
    def language(self):
        return self._language
    
    @language.setter
    def language(self, language):
        self._language = language
    
    @property
    def is_creative(self):
        return self._is_creative
    
    @is_creative.setter
    def is_creative(self, is_creative):
        self._is_creative = is_creative
    
    def process_task(self, task_content):
        """处理文本生成任务"""
        print(f"正在为【{self.name}】分配文本生成任务：{task_content}")
        
        # 模拟文本生成处理过程
        creative_tag = "（创意模式）" if self._is_creative else ""
        self.status_message = f"文本生成完成：{task_content}{creative_tag}"
        print(f"✅ {self.status_message}")
        return True
    
    def display_info(self):
        """显示助手的详细信息"""
        super().display_info()
        print(f"   支持的语言: {self._language}")
        print(f"   是否支持创意写作: {'是' if self._is_creative else '否'}")